function SearchVisualStudioFeature($SearchFor)
{
    $os = Get-WMIObject win32_operatingsystem
    [bool] $found = $False;
    
    # Seach in uninstall folder
    $found =  Test-Path ('HKLM:SOFTWARE\Microsoft\VisualStudio\10.0\InstalledProducts\' + $SearchFor);
    if ($found) { return $found; }
    
    #Search in 64 bit keys folders
    if ($os.OSArchitecture -eq "64-bit")
    {
        #Wow folder
        $found =  Test-Path ('HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\InstalledProducts\' + $SearchFor);
        if ($found)  { return $found; }
    }
	
    return $found;
}

function CheckVisualWebDeveloperExpress()
{
    if (Test-Path 'HKLM:SOFTWARE\Microsoft\DevDiv\VNS\Servicing\10.0')
    {
        return $true;
    }

    if (Test-Path 'HKLM:SOFTWARE\Wow6432Node\Microsoft\DevDiv\VNS\Servicing\10.0')
    {
        return $true;
    }

    if (Test-Path ('HKLM:SOFTWARE\Microsoft\VisualStudio\10.0\Setup\Microsoft Visual Web Developer 2010 Express *'))
    {
        return $true;
    }

    if (Test-Path ('HKLM:SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Setup\Microsoft Visual Web Developer 2010 Express *'))
    {
        return $true;
    }

    return $false;
}



$found = CheckVisualWebDeveloperExpress;
if($found) { return $found; }

$found = SearchVisualStudioFeature -SearchFor 'Visual Web Developer';
if($found) { return $found; }


return $found;

